#ifndef IMPORTER_H_
#define IMPORTER_H_

#include<QObject>
#include <QtXml/QXmlStreamReader>
#include <QFile>
#include <QSharedPointer>
#include "memoDb.h"

#include "set.hpp"

class Importer : public QObject{
	Q_OBJECT
public:
	Importer(MemoDb *db);
	Q_INVOKABLE bool Import(QString filePath, int categoryID);
private:
	QSharedPointer<Set> parseSet(QXmlStreamReader& xml);
	QSharedPointer<Question> parseQuestion(QXmlStreamReader& xml);
	QSharedPointer<Answer> parseAnswer(QXmlStreamReader& xml);

	MemoDb *m_db;
};

#endif /* IMPORTER_H_ */
